import request from '@/utils/request'

//查询厂家名称下拉框
export function listAllFactory() {
  return request({
    url: 'mgcmanage/producer/all',
    method: 'get',
  })
}


// 查询药品信息列表
export function listMedicine(query) {
  return request({
    url: '/mgcmanage/medicine/list',
    method: 'get',
    params: query
  })
}

// 新增药品
export function addMedicine(data) {
  return request({
    url: '/mgcmanage/medicine',
    method: 'post',
    data: data
  })
}

// 通过id查询药品详细，做数据回显，以便修改药品信息
export function getMedicine(mid) {
  return request({
    url: '/mgcmanage/medicine/' + mid,
    method: 'get'
  })
}



// 修改药品
export function updateMedicine(data) {
  return request({
    url: '/mgcmanage/medicine',
    method: 'put',
    data: data
  })
}

// 删除药品
export function delMedicine(mids) {
  return request({
    url: '/mgcmanage/medicine/' + mids,
    method: 'delete'
  })
}
